home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / newsgroups / misc.20000824-20010305 / 000379_news@columbia.edu _Fri Mar 2 09:49:57 2001.msg < prev    next >
Internet Message Format  |  2020-01-01  |  2KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by uhaligani.cc.columbia.edu (8.9.3/8.9.3) with ESMTP id JAA05841
  4.     for <kermit.misc@cpunix.cc.columbia.edu>; Fri, 2 Mar 2001 09:49:55 -0500 (EST)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id JAA14126
  7.     for kermit.misc@watsun.cc.columbia.edu; Fri, 2 Mar 2001 09:44:21 -0500 (EST)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: fdc@columbia.edu (Frank da Cruz)
  10. Subject: Re: DATE Calculation script help needed
  11. Date: 2 Mar 2001 14:44:20 GMT
  12. Organization: Columbia University
  13. Message-ID: <97obk4$dpc$1@newsmaster.cc.columbia.edu>
  14. To: kermit.misc@columbia.edu
  15.  
  16. In article <3A9F7510.1934F92B@att.com>,
  17. Siva K. Vejalla <svejalla@att.com> wrote:
  18. : I need big help in writing the script which can give me the
  19. : date X days back from today's date.
  20. : Ex: datecheck 70 # Argument is No. of days
  21. : # Assuming today's date is 013101
  22. : # Output should be 112200
  23. : It should consider previous month/year and Leap year or not
  24. : etc.
  25. : I tried it using shell script, but to include the previous
  26. : year/month logic seems to be tricky & time consuming the way
  27. : I am going.
  28. : If it matters, i am trying this on a Unix (HP-UX 11.0)
  29. : platform.
  30. HP-UX comes with C-Kermit installed in /bin/kermit.  Unfortunately
  31. it's not the current version, which is 7.0 and which you can
  32. find here:
  33.  
  34.   http://www.columbia.edu/kermit/ckermit.html
  35.  
  36. In C-Kermit 7.0 the command is:
  37.  
  38.   date +5days
  39.  
  40. Since you probably want to use the result for something, you can also
  41. include expressions like this in commands for file selection, e.g.:
  42.  
  43.   send /after:+5days *.txt
  44.  
  45. There is also a complete set of built-in functions for date and time 
  46. conversion and arithmetic.  See:
  47.  
  48.   http://www.columbia.edu/kermit/case17.html
  49.  
  50. - Frank